Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optimization option --fcombine-load-threshold=XXX #77

Merged
merged 5 commits into from
Apr 11, 2018

Conversation

nomaddo
Copy link
Collaborator

@nomaddo nomaddo commented Apr 6, 2018

Related #67.

This pullreq add --fcombine-load-threshold to adjust the threshold of CombineLoadingLiterals.
The impact of the optimization is huge (which is discussed in #67), users may specify the threshold.

It's better to control it by the compiler, but now there is no good way.

The naming rule is as follows:

  • optimization options should be long options.
  • the prefix of optimization options should be "--f".
  • words should be separated by "-". No captalize.

@nomaddo nomaddo requested a review from doe300 April 6, 2018 04:29
@@ -791,7 +791,6 @@ InstructionWalker optimizations::handleUseWithImmediate(
// and with constant/unsigned, etc.)
if(localIt->getSingleWriter() != nullptr)
it->addDecorations(intermediate::forwardDecorations(localIt->getSingleWriter()->decoration));
it.nextInBlock();
op->replaceLocal(oldLocal, tmp.local, LocalUse::Type::READER);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this instruction here? Was it a bug?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug. Fixed.

src/main.cpp Outdated
if(buffer == name)
{
std::getline(ss, buffer, '=');
if(name == buffer)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you re-test for the name?
I think it would be more obvious what is tested here if you reset buffer to an empty string and here test for the buffer still being empty.

Copy link
Collaborator Author

@nomaddo nomaddo Apr 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If input is --fcombine-load-threshold (just this, not including '='), ss reach the end. Then second std::getline do nothing. To detect it, name == buffer is needed here.
I add comments about this.

@doe300 doe300 merged commit dad9418 into doe300:master Apr 11, 2018
@nomaddo nomaddo deleted the addOption branch December 6, 2018 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants